// pcfw.scss
// 全局变量定义
$primary-color: #1890ff;
$success-color: #52c41a;
$warning-color: #faad14;
$error-color: #f5222d;
$text-color: #333;
$text-color-secondary: #666;
$text-color-light: #999;
$border-color: #e8e8e8;
$bg-color: #f5f7fa;
$font-size-base: 14px;
$border-radius-base: 6px;
$box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.09);

// 全局样式
.pc-fw-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: $bg-color;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: $text-color;
}

// 顶部导航栏样式
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  
  .logo-area {
    display: flex;
    align-items: center;
    
    .logo {
      font-size: 24px;
      font-weight: bold;
      color: $primary-color;
      margin-right: 8px;
    }
    
    .slogan {
      font-size: $font-size-base;
      color: $text-color-secondary;
    }
  }
  
  .nav-menu {
    display: flex;
    
    .nav-item {
      padding: 8px 16px;
      margin: 0 8px;
      cursor: pointer;
      border-radius: $border-radius-base;
      transition: all 0.3s;
      
      &:hover {
        color: $primary-color;
        background-color: rgba($primary-color, 0.1);
      }
      
      &.active {
        color: $primary-color;
        font-weight: 500;
        background-color: rgba($primary-color, 0.1);
      }
    }
  }
  
  .header-actions {
    display: flex;
    
    .icon {
      font-size: 18px;
      margin-left: 16px;
      cursor: pointer;
      transition: all 0.3s;
      
      &:hover {
        color: $primary-color;
        transform: scale(1.1);
      }
    }
  }
}

// 主内容区域
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

// 通用区域标题样式
.section-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
  color: $text-color;
  position: relative;
  padding-left: 12px;
  
  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 4px;
    background-color: $primary-color;
    border-radius: 2px;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  
  .section-subtitle {
    color: $text-color-secondary;
    font-size: $font-size-base;
  }
  
  .more-link {
    color: $primary-color;
    cursor: pointer;
    font-size: $font-size-base;
    
    &:hover {
      text-decoration: underline;
    }
  }
}

// 轮播图区域
.banner-section {
  margin-bottom: 32px;
  
  .banner-container {
    border-radius: $border-radius-base;
    overflow: hidden;
    box-shadow: $box-shadow-base;
  }
  
  .banner-swiper {
    height: 320px;
    
    .banner-item {
      position: relative;
      height: 100%;
      display: flex;
      align-items: center;
      overflow: hidden;
    }
    
    .banner-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .banner-content {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 24px;
      background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
      color: #fff;
      
      .banner-title {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 8px;
        display: block;
      }
      
      .banner-subtitle {
        font-size: 16px;
        margin-bottom: 8px;
        display: block;
      }
      
      .banner-description {
        font-size: $font-size-base;
        margin-bottom: 12px;
        display: block;
        opacity: 0.9;
      }
      
      .banner-tag {
        display: inline-block;
        padding: 4px 8px;
        background-color: $primary-color;
        border-radius: 4px;
        font-size: 12px;
      }
    }
  }
}

// 服务分类区域
.categories-section {
  margin-bottom: 32px;
  
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    
    .category-card {
      background-color: #fff;
      border-radius: $border-radius-base;
      padding: 16px;
      display: flex;
      align-items: center;
      cursor: pointer;
      transition: all 0.3s;
      box-shadow: $box-shadow-base;
      
      &:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      .category-icon {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        margin-right: 12px;
        flex-shrink: 0;
      }
      
      .category-info {
        flex: 1;
        
        .category-name {
          font-weight: 500;
          margin-bottom: 4px;
          display: block;
        }
        
        .category-count {
          font-size: 12px;
          color: $text-color-light;
        }
      }
    }
  }
}

// 热门服务区域
.hot-services-section {
  margin-bottom: 32px;
  
  .services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    
    .service-card {
      background-color: #fff;
      border-radius: $border-radius-base;
      overflow: hidden;
      box-shadow: $box-shadow-base;
      transition: all 0.3s;
      cursor: pointer;
      
      &:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        
        .service-image {
          transform: scale(1.05);
        }
      }
      
      .service-image {
        width: 100%;
        height: 180px;
        object-fit: cover;
        transition: transform 0.5s;
      }
      
      .service-info {
        padding: 16px;
        
        .service-name {
          font-size: 16px;
          font-weight: 500;
          margin-bottom: 8px;
          display: block;
        }
        
        .service-price-info {
          display: flex;
          align-items: center;
          margin-bottom: 8px;
          
          .service-price {
            font-size: 18px;
            font-weight: bold;
            color: $error-color;
            margin-right: 8px;
          }
          
          .service-original-price {
            font-size: 14px;
            color: $text-color-light;
            text-decoration: line-through;
          }
        }
        
        .service-meta {
          display: flex;
          align-items: center;
          margin-bottom: 12px;
          
          .service-rating {
            font-size: 13px;
            margin-right: 16px;
            color: $warning-color;
          }
          
          .service-orders {
            font-size: 13px;
            color: $text-color-light;
          }
        }
        
        .service-tags {
          display: flex;
          flex-wrap: wrap;
          
          .service-tag {
            font-size: 12px;
            padding: 2px 6px;
            background-color: rgba($primary-color, 0.1);
            color: $primary-color;
            border-radius: 2px;
            margin-right: 8px;
            margin-bottom: 4px;
          }
        }
      }
    }
  }
}

// 服务资讯区域
.news-section {
  margin-bottom: 32px;
  
  .news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    
    .news-card {
      background-color: #fff;
      border-radius: $border-radius-base;
      padding: 16px;
      box-shadow: $box-shadow-base;
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      .news-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        
        .news-category {
          font-size: 12px;
          padding: 2px 8px;
          background-color: rgba($primary-color, 0.1);
          color: $primary-color;
          border-radius: 10px;
        }
        
        .news-time {
          font-size: 12px;
          color: $text-color-light;
        }
      }
      
      .news-title {
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 8px;
        display: block;
        cursor: pointer;
        
        &:hover {
          color: $primary-color;
        }
      }
      
      .news-content {
        font-size: 13px;
        color: $text-color-secondary;
        margin-bottom: 12px;
        display: block;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      
      .news-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        
        .news-views {
          font-size: 12px;
          color: $text-color-light;
        }
        
        .news-read-more {
          font-size: 12px;
          color: $primary-color;
          cursor: pointer;
          
          &:hover {
            text-decoration: underline;
          }
        }
      }
    }
  }
}

// 服务保障区域
.guarantee-section {
  margin-bottom: 32px;
  
  .guarantee-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    
    .guarantee-item {
      background-color: #fff;
      border-radius: $border-radius-base;
      padding: 24px 16px;
      text-align: center;
      box-shadow: $box-shadow-base;
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
      }
      
      .guarantee-icon {
        font-size: 36px;
        margin-bottom: 12px;
        display: block;
      }
      
      .guarantee-title {
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 8px;
        display: block;
      }
      
      .guarantee-desc {
        font-size: 13px;
        color: $text-color-secondary;
      }
    }
  }
}

// 页脚样式
.footer {
  background-color: #fff;
  padding: 32px 24px 16px;
  margin-top: 32px;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);
  
  .footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 24px;
    
    .footer-section {
      .footer-title {
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 12px;
        display: block;
      }
      
      & > text {
        display: block;
        font-size: 13px;
        color: $text-color-secondary;
        margin-bottom: 6px;
        cursor: pointer;
        
        &:hover {
          color: $primary-color;
        }
      }
    }
  }
  
  .copyright {
    text-align: center;
    font-size: 12px;
    color: $text-color-light;
    padding-top: 16px;
    border-top: 1px solid $border-color;
    max-width: 1200px;
    margin: 0 auto;
  }
}

// 响应式设计
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  .guarantee-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
    
    .nav-menu {
      .nav-item {
        padding: 6px 12px;
        margin: 0 4px;
      }
    }
    
    .header-actions .icon {
      margin-left: 12px;
    }
  }
  
  .main-content {
    padding: 16px;
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .services-grid {
    grid-template-columns: 1fr !important;
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .guarantee-grid {
    grid-template-columns: 1fr !important;
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px;
    
    .logo-area {
      margin-bottom: 8px;
      width: 100%;
      justify-content: center;
    }
    
    .nav-menu {
      width: 100%;
      justify-content: center;
      margin-bottom: 8px;
    }
    
    .header-actions {
      width: 100%;
      justify-content: center;
    }
  }
  
  .categories-grid,
  .news-grid {
    grid-template-columns: 1fr !important;
  }
  
  .footer-content {
    grid-template-columns: 1fr !important;
  }
}